<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Logout extends CI_Controller {
	function index(){
		//$this->session->set_userdata('ych_user','');
		$headers = apache_request_headers();
		$user_id = isset($headers['user_id'])? intval($headers['user_id']) : 0;
		$token = isset($headers['token'])? $headers['token'] : '';
		$token_key = 'token_'.$user_id;
		$token_val = $this->mycache->delete($token_key);
		
		$ret['msg'] = '您已退出';
		$ret['code'] = 0;
		echo json_encode($ret);
		exit;
	}
}